Trilium uses a progressive search strategy that performs exact matching first, then adds fuzzy matching when needed.
The search has three phases:
Search system specifications:
The "full" syntax for searching by labels is:
note.labels.publicationYear = 1954
For relations:
note.relations.author.title *=* Tolkien
However, common label and relation searches have shortcut syntax:
#publicationYear = 1954
~author.title *=* Tolkien
Search syntax allows combining full-text search with attribute-based search.
For example, tolkien #book contains:
tolkien
#book
Trilium detects the separation between full text search and attribute/property search by looking for certain special characters or words that denote attributes and properties (e.g., #, ~, note.). If you need to include these in full-text search, escape them with a backslash so they are processed as regular text:
"note.txt"
\#hash
#myLabel = 'Say "Hello World"'
Special characters can be enclosed in quotes or escaped with a backslash to be used in full-text search:
"note.txt"
\#hash
#myLabel = 'Say "Hello World"'
Three types of quotes are supported: single, double, and backtick.
Label values are technically strings but can be coerced for numeric comparisons:
note.dateCreated =* '2019-05'
This finds notes created in May 2019. Numeric operators like #publicationYear >= 1960 convert
string values to numbers for comparison.